  var left = 0;
        var index = 4;
        $(function () {
                var $list = $("ol li");

                $("#right_button").click(function () {

                        $("ol li:eq(" + index + ")").addClass("active");
                        $("ol li:eq(" + (index - 1) + ")").addClass("active");
                        $("ol li:eq(" + index + ")").css("transform", "scale(1.0)");
                        $("ol li:eq(" + (index - 1) + ")").css("transform", "scale(1.8)");


                        $('.nav-bar-container').animate({
                                left: '+=280',
                        }, 500, function () {
                                $("ol li:eq(" + index + ")").removeClass("active");
                                $("ol li:eq(" + (index - 1) + ")").removeClass("active");
                                if (left == '-280px') {
                                        $('.nav-bar-container').css("left", "-2520px");
                                        $("ol li:eq(10)").css("transform", "scale(1.8)");
                                        $("ol li:eq(1)").css("transform", "scale(1.0)");
                                }
                                left = $('.nav-bar-container').css("left");
                                var leftNum = parseInt(left);
                                index = leftNum / 280;
                                if (index < 0) {
                                        index = -index + 1;
                                } else {
                                        index = index + 1;
                                }

                                console.log(index);

                        });
                })
                $("#left_button").click(function () {
                        $("ol li:eq(" + index + ")").addClass("active");
                        $("ol li:eq(" + (index + 1) + ")").addClass("active");
                        $("ol li:eq(" + index + ")").css("transform", "scale(1.0)");
                        $("ol li:eq(" + (index + 1) + ")").css("transform", "scale(1.8)");
                        $('.nav-bar-container').animate({
                                left: '-=280',
                        }, 500, function () {
                                $("ol li:eq(" + index + ")").removeClass("active");
                                $("ol li:eq(" + (index + 1) + ")").removeClass("active");

                                if (left == "-3080px") {
                                        $('.nav-bar-container').css("left", "-840px");
                                        $("ol li:eq(4)").css("transform", "scale(1.8)");
                                        $("ol li:eq(13)").css("transform", "scale(1.0)");
                                }
                                left = $('.nav-bar-container').css("left");
                                var leftNum = parseInt(left);
                                index = leftNum / 280;
                                if (index < 0) {
                                        index = -index + 1;
                                } else {
                                        index = index + 1;
                                }
                                console.log(index);
                        });
                })
        })